<template>
  <div class="date">
    <Title2>
      <div slot="back">
        <van-icon name="arrow-left" @click="$router.go(-1)" />
      </div>
      <div slot="title">学习日历</div>
    </Title2>
    
  </div>
</template>

<script>
import Title2 from "../components/common/Title2";
export default {
  data: () => ({
    
  }),
  methods: {
    
  },
  mounted() {
    //   new Date()第3个参数默认为1，就是每个月的1号，把它设置为0时， new Date()会返回上一个月的最后一天，然后通过getDate()方法得到天数
      console.log(new Date(2020,4,0).getDate());//查看4月最后一天
    //   每个星期的第一天是周日，所以周日--周六对应的0-6
      console.log(new Date(2020,3,1).getDay());//查看4月1是星期几
    // console.log(new Date(2020, 3, 0).getDate()); //查看3月最后一天
    // console.log(new Date(2020, 2, 1).getDay()); //查看3月1是星期几
    // this.days = new Date(this.year, this.month, 0).getDate();
    // this.weekDay = new Date(this.year, this.month - 1, 1).getDay();
  },
  components: {
    Title2
  }
};
</script>

<style lang="scss" scoped>
.days {
  width: 90%;
  margin: 0 auto;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-flow: wrap;
  div {
    width: 30px;
    height: 30px;
    text-align: center;
    line-height: 30px;
    margin: 9px;
  }
}
.title {
  width: 100%;
  height: 40px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  font-size: 25px;
  .van-icon {
    margin-left: 20px;
  }
}
.week {
  width: 90%;
  margin: 0 auto;
  height: 40px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  div {
    width: 14.2%;
    text-align: center;
    color: rgb(130, 130, 130);
  }
}
.today {
  background: rgb(200, 200, 200);
  border-radius: 30px;
}
.active {
  background: rgb(223, 109, 44);
  border-radius: 30px;
}
</style>